package concurrencyCookBook.product;

public class C {
	private Object obj;
	private Value v;

	public C(Object obj,Value v) {
		this.obj = obj;
		this.v=v;
	}

	public Value getV() {
		return v;
	}

	public void setV(Value v) {
		this.v = v;
	}


	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}
	
	public void getValue() throws InterruptedException{
		synchronized (obj) {
			if("".equals(v.getV())){
				obj.wait();
			}
			System.out.println(v.getV()+"===cccc");
			v.setV("");
			obj.notifyAll();
		}
	}

}
